package com.example.shop.shops.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.shop.base.aop.MyLog;
import com.example.shop.shops.domain.Log;
import com.example.shop.shops.mapper.LogMapper;
import com.example.shop.shops.service.LogService;
import com.example.shop.util.PageList;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Hasee
 * @description 针对表【t_shop_audit_log】的数据库操作Service实现
 * @createDate 2022-11-22 08:36:05
 */
@Service
public class LogServiceImpl extends ServiceImpl<LogMapper, Log> implements LogService {

    @Override
    @MyLog(value = "查询日志信息")
    public PageList<Log> getList(Long shopId) {
        PageList<Log> pageList = new PageList<>();
        System.out.println(shopId);
        QueryWrapper<Log> logQueryWrapper = new QueryWrapper<>();
        logQueryWrapper.eq("shop_id", shopId);
        List<Log> logs = baseMapper.selectList(logQueryWrapper);
        pageList.setRows(logs);
        return pageList;
    }
}




